package order_by

import "gitee.com/go-web-2/orm_framework/predicate"

type OrderType string

func (o OrderType) String() string {
	return string(o)
}

var (
	Asc  OrderType = "ASC"
	Desc OrderType = "DESC"
)

type OrderBy struct {
	Column predicate.Column
	Order  OrderType
}

func ASC(column predicate.Column) OrderBy {
	return OrderBy{
		Column: column,
		Order:  Asc,
	}
}

func DESC(column predicate.Column) OrderBy {
	return OrderBy{
		Column: column,
		Order:  Desc,
	}
}
